<html>
  <head>
    <script type="text/javascript"><!--
      soundlist = [" <?php echo $file; ?>", 'C:/pleiades/xampp/htdocs/sf.midi1.com/tmp/1334.mid ', 'bossa.mid'] ;

      function soundPlay(n) {
        var option = '"' ;
        option += ' autostart = "<?php $autostart;?>"' ; // 自動再生
        option += ' loop = "<?php $loop;?>"' ; // ループ再生
        document.getElementById('player').innerHTML = '<embed src="' + soundlist[n-1] + option + ' />' ;
      }

      function soundStop() {
        document.getElementById('player').innerHTML = '' ;
      }
      //-->
    </script>
  </head>

  <body>
  <?php echo $file;?>
    <form>
      <button type="button" onclick="soundPlay(1)">音楽1</button>
      <button type="button" onclick="soundPlay(2)">音楽2</button>
      <button type="button" onclick="soundPlay(3)">音楽3</button>
      <button type="button" onclick="soundStop()">停止</button>
    </form>

    <div id="player" style="display:visible"></div><?php //display:none なら見えないが演奏できない?>
  </body>
</html>